'use strict';
// 部门 表
module.exports = {
  up: async (queryInterface, Sequelize) => {
    const { INTEGER, STRING, DATE, ENUM } = Sequelize;
    // 创建表
    await queryInterface.createTable('admin_depart', {
      id: {
        type: INTEGER(30).UNSIGNED,
        primaryKey: true,
        autoIncrement: true
      },
      parent: {
        type: INTEGER(30),
        allowNull: false,
        defaultValue: 0,
        comment: '父级id',
      },
      name: {
        type: STRING(100),
        allowNull: false,
        defaultValue: '',
        comment: '名称',
      },
      created_at: DATE,
      updated_at: DATE,
    });
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.dropTable('admin_depart');
  }
};